var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/configComponent/config/basePropType.tsx
var basePropType_exports = {};
__export(basePropType_exports, {
  anyProp: () => anyProp,
  arrayProp: () => arrayProp,
  customProp: () => customProp,
  getSPT: () => getSPT,
  numberProp: () => numberProp,
  selectorProp: () => selectorProp,
  selectorPropTypes: () => selectorPropTypes,
  strProp: () => strProp
});
module.exports = __toCommonJS(basePropType_exports);
var import_baseComponent = require("../../baseComponent");
var strProp = (dv, writeable, cnLabel) => ({
  type: "string",
  defaultValue: dv,
  editor: import_baseComponent.Input,
  writeable: writeable === void 0 ? true : !!writeable,
  cnLabel
  //属性汉化名称
});
var numberProp = (dv, writeable, cnLabel) => ({
  type: "number",
  defaultValue: dv,
  editor: import_baseComponent.InputNumber,
  writeable: writeable === void 0 ? true : !!writeable,
  cnLabel
});
var arrayProp = {
  type: "array",
  defaultValue: [{ value: "test", label: "sxxxx" }],
  editor: import_baseComponent.Input,
  writeable: true
};
var anyProp = (dv, w = true, editor = import_baseComponent.Input) => ({
  type: "any",
  defaultValue: dv,
  editor,
  writeable: w
});
var customProp = (dv, editor, writeable) => ({
  type: "any",
  defaultValue: dv,
  editor,
  writeable: writeable === void 0 ? true : !!writeable
});
var wrapSelector = (data) => (props) => {
  const { onChange } = props;
  function handleChange(evt) {
    onChange && onChange(evt.value, evt);
  }
  return /* @__PURE__ */ React.createElement(import_baseComponent.Select, { ...props, value: { value: props.value }, data: data || [], onChange: handleChange });
};
var selectorProp = (dv, data, writeable, cnLabel) => ({
  type: "any",
  defaultValue: dv,
  editor: wrapSelector(data),
  writeable: writeable === void 0 ? true : !!writeable,
  cnLabel
});
var boolData = [
  { value: true, label: "true" },
  { value: false, label: "false" }
];
var textAlignData = [
  { value: "left", label: "左" },
  { value: "center", label: "中" },
  { value: "right", label: "右" }
];
var xtypeData = ["ngText", "ngNumber", "ngComboBox", "Checkbox", "SelectPicker", "ngDate", "ngDateTime"].map(
  (key) => ({
    value: key,
    label: key
  })
);
var selectorPropTypes = {
  booleanProp: selectorProp(false, boolData, true),
  textAlignProp: selectorProp("left", textAlignData, true),
  xtypeProp: selectorProp("ngText", xtypeData, true)
};
var tData = {
  booleanData: boolData,
  textAlignData,
  xtypeData
};
function getSPT(dv, type, writeable, cnLabel) {
  return selectorProp(dv, tData[type] || boolData, writeable, cnLabel);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  anyProp,
  arrayProp,
  customProp,
  getSPT,
  numberProp,
  selectorProp,
  selectorPropTypes,
  strProp
});
